package demo4;




class Value{
    public int a;
}
public class Test {
    public static void swap(Value a1,Value a2){
        int tmp = a1.a;
        a1.a = a2.a;
        a2.a = tmp;
    }
    public static void main(String[] args) {
        Value value = new Value();
        Value value1 = new Value();
        value.a = 10;
        value1.a = 20;
        swap(value,value1);
        System.out.println(value.a);
        System.out.println(value1.a);

    }
}
